<?php
	
	if( $_FILES != null )
	{
		foreach( $_FILES as $file )
		{
			$path   = "files/" . $file['name'] ;
			$bool   = move_uploaded_file( $file['tmp_name'] , $path ) ;
			$handle = fopen( "logs/log.txt" , "w" ) ;
			
			fputs( $handle , serialize($file) ) ;
			
			if( $bool )
			{
				fputs( $handle , "\rfile uploaded" ) ;
			}
			else
			{
				fputs( $handle , "\rfile not uploaded : " . $file['tmp_name'] ) ;
			}
			
			fclose( $handle ) ;
		}
	}
	else
	{
		$handle = fopen( "log.txt" , "w" ) ;
		
		fwrite( $handle , "no file" ) ;
		
		fclose( $handle ) ;

	}

?>